package com.reefe.config.redis;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.stereotype.Component;

/** 
* @ClassName: RedisCfg
* @Description: redis信息类
* @author REEFE
* @date 2017-4-25 下午1:42:14
*  springboot1.5.x ConfigurationProperties location属性取消，
 *  所以通过PropertySource来指定自定义.properties或者.yml文件
 *  需要在使用该自定义配置类中使用@EnableConfigurationProperties(RedisCfg.class) 激活绑定的bean
*/
@Component("redisCfg")
@ConfigurationProperties(prefix="redis")
@PropertySource(value = "classpath:redis.properties")
public class RedisCfg {
	private String host;
	private String password;
	private int database;
	private int port;
	private int timeout;
	private int maxIdle;
	private long maxWaitMillis;


	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	public int getTimeout() {
		return timeout;
	}
	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}
	public int getDatabase() {
		return database;
	}
	public void setDatabase(int database) {
		this.database = database;
	}
	public String getHost() {
		return host;
	}
	public void setHost(String host) {
		this.host = host;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	public int getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
	}

	public long getMaxWaitMillis() {
		return maxWaitMillis;
	}

	public void setMaxWaitMillis(long maxWaitMillis) {
		this.maxWaitMillis = maxWaitMillis;
	}
}